<?php
require 'execute/auth.php';
require 'config/config.php';

mydb_connect();
?>
<!DOCTYPE html>

<!--[if lt IE 7 ]><html lang="en" class="ie6 ielt7 ielt8 ielt9"><![endif]--><!--[if IE 7 ]><html lang="en" class="ie7 ielt8 ielt9"><![endif]--><!--[if IE 8 ]><html lang="en" class="ie8 ielt9"><![endif]--><!--[if IE 9 ]><html lang="en" class="ie9"> <![endif]--><!--[if (gt IE 9)|!(IE)]><!--> 
<html lang="en"><!--<![endif]--> 
	
<!-- Mirrored from wbpreview.com/previews/WB0070A9H/index.htm by HTTrack Website Copier/3.x [XR&CO'2013], Wed, 22 Jan 2014 10:30:52 GMT -->
<head>
		<meta charset="utf-8">
		<title>Dashboard - TechAfghanistan</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="keywords" content="opensource rich wysiwyg text editor jquery bootstrap execCommand html5" />
    <meta name="description" content="This tiny jQuery Bootstrap WYSIWYG plugin turns any DIV into a HTML5 rich text editor" />
    <link rel="apple-touch-icon" href="http://mindmup.s3.amazonaws.com/lib/img/apple-touch-icon.png" />
    <link rel="shortcut icon" href="http://mindmup.s3.amazonaws.com/lib/img/favicon.ico" >
    <link href="js/external/google-code-prettify/prettify.css" rel="stylesheet">
    <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
    <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" rel="stylesheet">
		<link href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    <script src="http://malsup.github.io/jquery.form.js"></script>
		<script src="js/external/jquery.hotkeys.js"></script>
    <script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
    <script src="js/external/google-code-prettify/prettify.js"></script>
		<link href="css/index.css" rel="stylesheet">
    <script src="js/bootstrap-wysiwyg.js"></script>


<script type="text/javascript">
$(function(){
	$(".editPost").on("click",function(){
jQuery.param.querystring(window.location.href, 'valueA=321&valueB=123');
	});
});
</script>
		<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
	<style type="text/css">
 		#editor {
 			overflow:scroll; 
 			max-height:250px;
 			width: 650px;
 		}
	</style>	
	<script type="text/javascript">	
		$(function(){
			$('#show_link').click(function(event) {
  $('html').one('click',function() {
				$("#link").hide();
  });

  event.stopPropagation();
});
		});
		</script>	
	<link href="css/site.css" rel="stylesheet">
	<script type="text/javascript">
		$(function(){
			$("#show_link").on("click",function(){
				$("#link").show();
			});

			$("#editor").on("keyup",function(){
				$(".content").html($(this).html());
			});
		});
	</script>
	

		<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
	</head>
	<body>
		<div class="container">
			<div class="navbar">
				<div class="navbar-inner">
				<div class="container">
						<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="#">TechAfghanistan</a>
						<div class="nav-collapse">
							<ul class="nav">
									<li class="dropdown">
									<a href="help.html" class="dropdown-toggle" data-toggle="dropdown">Tours <b class="caret"></b></a>
									<ul class="dropdown-menu">
										<li>
											<a class="addLink" href="help.html">Introduction Tour</a>
										</li>
										<li>
											<a href="help.html">Project Organisation</a>
										</li>
										<li>
											<a href="help.html">Task Assignment</a>
										</li>
										<li>
											<a href="help.html">Access Permissions</a>
										</li>
										<li class="divider">
										</li>
										<li class="nav-header">
											Files
										</li>
										<li>
											<a href="help.html">How to upload multiple files</a>
										</li>
										<li>
											<a href="help.html">Using file version</a>
										</li>
									</ul>
								</li>
							</ul>
							<form class="navbar-search pull-right" action="#">
								<input type="text" class="search-query span2" placeholder="Search" />
							</form>
							<ul class="nav pull-right">
								<li>
									<?php if(isset($_SESSION['USER_ID'])){
							            ?>
							          
							         <li style="margin-top:10px;"> Welcome: <?php echo $_SESSION['FNAME'];}
							          ?></li>
							       
								</li>
								
							</ul>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="span3">
					<div class="well" style="padding: 8px 0;">
						<ul class="nav nav-list">
							<li class="nav-header">
								TechAfghanistan
							</li>
							<li>
								<a href="index.php"><i class="icon-home"></i> Dashboard</a>
							</li>
							<li>
								<a href="news.php"><i class="icon-home"></i> Posts</a>
							</li>
						</ul>
					</div>
				</div>
			<?php
			 $user = $conn->query("SELECT * FROM `users` WHERE id = '".$_SESSION['USER_ID']."'");
                $userRow = $user->fetch();
                //echo $userRow['id'];

                $user_profile_qry = $conn->query("SELECT * FROM `user_authors` WHERE id = '".$userRow['id']."'");
                $user_profile = $user_profile_qry->fetch();
                ?>
					
					<form id="new-file" action="" method="post" enctype="multipart/form-data" class="form-horizontal ">
						<fieldset>
							<H2 style="padding-left:88px;">Profile</H2>
							<hr>
							<div class="control-group">
								<label class="control-label" for="textarea">Twitter ID</label>
								<div class="controls">
									<input type="text" class="input-xlarge" name="title" id="input01" value="<?php echo $user_profile['twitter_id']; ?>" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="textarea">First Name</label>
								<div class="controls">
									<input type="text" class="input-xlarge" name="title" id="input01" value="<?php echo 
									$userRow['firstname'];?>" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="textarea">Last Name</label>
								<div class="controls">
									<input type="text" class="input-xlarge" name="title" id="input01" value="<?php echo 
									$userRow['lastname'];?>" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="textarea">Email</label>
								<div class="controls">
									<input type="text" class="input-xlarge" name="title" id="input01" value="<?php echo 
									$userRow['email'];?>"/>
								</div>
							</div>
							<div class="control-group">
							  <label class="control-label" for="bio">Bio</label>
							  <div class="controls">                     
							    <textarea id="bio" name="bio" value="<?php echo $user_profile['bio']; ?>"></textarea>
							  </div>
							</div>

							<div class="control-group">
								<label class="control-label" for="textarea">Facebook Profile</label>
								<div class="controls">
									<input type="text" class="input-xlarge" name="title" id="input01" value="<?php echo $user_profile['facebook_url']; ?>"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="textarea">Linkdin Profile</label>
								<div class="controls">
									<input type="text" class="input-xlarge" name="title" id="input01" value="<?php echo 
									$user_profile['linkdin_url'];?>"/>
								</div>
							</div>
							<div class="control-group">
							  <label class="control-label" for="image">Image</label>
							  <div class="controls">
							    <input id="image" name="image" class="input-file" type="file">
							  </div>
							</div>
							<div class="form-actions">
								<button type="submit" name="submit" class="btn btn-primary">Edit Profile</button> <button type="reset" class="btn">Cancel</button>
							</div>
						</fieldset>
					</form>

	</body>

</html>